/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package seso;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;

/**
 *
 * @author Administrator
 */
public class RDataPanel extends javax.swing.JPanel {
    Image topLeftImage = Util.getUserImage("PanelBgTopLeft.png");
    Image topMiddleImage = Util.getUserImage("PanelBgTopMiddle.png");
    Image topRightImage = Util.getUserImage("PanelBgTopRight.png");
    Image bottomLeftImage = Util.getUserImage("PanelBgBottomLeft.png");
    Image bottomMiddleImage = Util.getUserImage("PanelBgBottomMiddle.png");
    Image bottomRightImage = Util.getUserImage("PanelBgBottomRight.png");
    int imageWidth = topLeftImage.getWidth(null);
    
    public RDataPanel() {
        super();
        setLayout(null);
        setSize(100, 20);
        setPreferredSize(getSize());
        setBackground(new Color(244,244,244));
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);

        int width = getWidth(), height = getHeight();
        
        g.drawImage(topLeftImage, 0, 0, imageWidth, imageWidth, null);
        g.drawImage(topMiddleImage, imageWidth, 0, width - imageWidth * 2, imageWidth, null);
        g.drawImage(topRightImage, width - imageWidth, 0, imageWidth, imageWidth, null);
        
        g.drawImage(bottomLeftImage, 0, imageWidth, imageWidth, height - imageWidth, null);
        g.drawImage(bottomMiddleImage, imageWidth, imageWidth, width - imageWidth * 2, height - imageWidth, null);
        g.drawImage(bottomRightImage, width - imageWidth, imageWidth, imageWidth, height - imageWidth, null);
    }
 

}
